package com.niuke;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * 59. 字符匹配
 * https://blog.csdn.net/qq_34143141/article/details/131667098
 */
public class NiukeMoni59 {

    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        String[] line1 = scanner.nextLine().split(" ");
        String regex = scanner.nextLine();

        List<Integer> result = new ArrayList<>();
        for (int i = 0; i < line1.length; i++) {
            if (line1[i].matches(regex)) {
                result.add(i);
            }
        }

        for (int i = 0; i < result.size(); i++) {
            if (i == result.size() - 1) {
                System.out.println(result.get(i));
            } else {
                System.out.print(result.get(i) + ",");
            }
        }

    }

}
